package com.ctsi.security.domain;

import java.io.Serializable;

public class RoleDataObject implements Serializable{
	private String id;
	private String roleId;
	private String dataObjectId;
	private String dataObjectTypeId;
	private String dataObjectAction;
	private String dataObjectName;
	private String dataObjectTypeName;
	private String sortfactor;

	public static final String ALL = "ALL"; // 本级以下所有
	public static final String LOWALL = "LOWALL"; //本级及以下所有权限
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	public String getDataObjectId() {
		return dataObjectId;
	}
	public void setDataObjectId(String dataObjectId) {
		this.dataObjectId = dataObjectId;
	}
	public String getDataObjectTypeId() {
		return dataObjectTypeId;
	}
	public void setDataObjectTypeId(String dataObjectTypeId) {
		this.dataObjectTypeId = dataObjectTypeId;
	}
	public String getDataObjectAction() {
		return dataObjectAction;
	}
	public void setDataObjectAction(String dataObjectAction) {
		this.dataObjectAction = dataObjectAction;
	}
	public String getDataObjectName() {
		return dataObjectName;
	}
	public void setDataObjectName(String dataObjectName) {
		this.dataObjectName = dataObjectName;
	}
	public String getDataObjectTypeName() {
		return dataObjectTypeName;
	}
	public void setDataObjectTypeName(String dataObjectTypeName) {
		this.dataObjectTypeName = dataObjectTypeName;
	}

	public void setSortfactor(String sortfactor) {
		this.sortfactor = sortfactor;
	}
	public String getSortfactor() {
		if(sortfactor==null){
			setSortfactor( this.dataObjectTypeId+"-"+this.getDataObjectId()+"-"+this.getDataObjectAction());
		}
		return sortfactor;
	}
	public boolean isDataObjectType(){
		return dataObjectId.equals(dataObjectTypeId+ALL);
	}
	public String toString(){
		return dataObjectId+dataObjectAction;
	}

}
